//
//  ViewController.m
//  07-HomeWork
//
//  Created by dllo on 16/7/22.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ViewController.h"
#import "TabBarCellView.h"
#import "HomePageViewController.h"
#import "NewsViewController.h"
#import "FindViewController.h"
#import "MeViewController.h"
#define kScreenBounds  [UIScreen mainScreen].bounds
#define kScreenWidth   [UIScreen mainScreen].bounds.size.width
#define kScreenHeight  [UIScreen mainScreen].bounds.size.height

@interface ViewController ()

@end

@implementation ViewController
- (void)loadView {
    [super loadView];
    self.edgesForExtendedLayout = UIRectEdgeNone;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    TabBarCellView *HomePageView = [[TabBarCellView alloc] initWithFrame:CGRectMake(0, kScreenHeight - 49, kScreenWidth / 4, 39) backGroundImage:[UIImage imageNamed:@"HomePage"] title:@"首页"];
    [self.view addSubview:HomePageView];
    [HomePageView tabBarAddTarget:self action:@selector(homePageClicked:) forControlEvents:UIControlEventTouchUpInside];
    
    TabBarCellView *newsView = [[TabBarCellView alloc] initWithFrame:CGRectMake(kScreenWidth / 4 * 1, kScreenHeight - 49, kScreenWidth / 4, 39) backGroundImage:[UIImage imageNamed:@"News"] title:@"消息"];
    [self.view addSubview:newsView];
    [newsView tabBarAddTarget:self action:@selector(newsClicked:) forControlEvents:UIControlEventTouchUpInside];
    
    
    TabBarCellView *findView = [[TabBarCellView alloc] initWithFrame:CGRectMake(kScreenWidth / 4 * 2, kScreenHeight - 49, kScreenWidth / 4, 39) backGroundImage:[UIImage imageNamed:@"Find"] title:@"发现"];
    [self.view addSubview:findView];
    [findView tabBarAddTarget:self action:@selector(findClicked:) forControlEvents:UIControlEventTouchUpInside];
    
    TabBarCellView *meView = [[TabBarCellView alloc] initWithFrame:CGRectMake(kScreenWidth / 4 * 3, kScreenHeight - 49, kScreenWidth / 4, 39) backGroundImage:[UIImage imageNamed:@"Me"] title:@"我"];
    [self.view addSubview:meView];
    [meView tabBarAddTarget:self action:@selector(meClicked:) forControlEvents:UIControlEventTouchUpInside];
}
- (void)homePageClicked:(UIButton *)button {
  
}
- (void)newsClicked:(UIButton *)button {
    
}
- (void)findClicked:(UIButton *)button {
    
}
- (void)meClicked:(UIButton *)button {
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
